package com.cloudptt.api.product.func.message;

import java.io.File;

import com.cloudptt.api.comm.Common;
import com.cloudptt.api.product.func.IFunc;
import com.cloudptt.api.product.log.Log;
import com.cloudptt.api.product.operator.MsgOperator;
import com.mcptt.config.model.McIdInfo;
import com.mcptt.config.model.ServerInfo;
import com.mcptt.db.model.SessionInfo;
import com.mcptt.db.op.HistoryDbOperator;
import com.mcptt.db.op.MapDbOperator;

import android.content.Context;
import android.os.Environment;

public class MsgFunc  implements IFunc
{
	public final static String Log_Key = "MsgAgent";
	private MsgBroadcast broadcast = null;

	public MsgFunc(Context ctx, HistoryDbOperator dbOperater, MapDbOperator onlineDbOperator, MsgOperator msgOp)
	{
		this.broadcast = new MsgBroadcast(ctx,dbOperater,onlineDbOperator,msgOp);
	}

	public void setMsgListener(MsgListener listener) {
		this.broadcast.setMsgListener(listener);
	}
	
	public void setNotifyListener(NotifyListener listener) {
		this.broadcast.setNotifyListener(listener);
	}

	public void setAppLogListener(AppLogListener appLogListener) {
		Log.d(MsgFunc.Log_Key, "setAppLogListener setAppLogListener = " + appLogListener);
		this.broadcast.setAppLogListener(appLogListener);
	}
	
	@Override
	public void onLogined(McIdInfo mcIdInfo,ServerInfo info,boolean isLoginSuc) {
		// TODO Auto-generated method stub
	}
	@Override
	public void doNetworkChange(boolean isConn)
	{
		Log.d(Log_Key, "networkOffline isConn = " + isConn);
	}
	@Override
	public void doForceDetach()
	{
		Log.d(Log_Key, "doForceDetach");
	}
	@Override
	public void doLogout() {
		// TODO Auto-generated method stub
		Log.d(Log_Key, "doLogout");
	}
	@Override
	public void doExit()
	{
		this.broadcast.clearResource();
		this.broadcast = null;
	}

	@Override
	public void onLanChange(String lanType) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onKeepAlive(boolean isconnected) {
		// TODO Auto-generated method stub
		
	}
	

	
	
}
